#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
  bool asteroidsDestroyed(int mass, vector<int> &asteroids)
  {
    long long num = mass;
    sort(asteroids.begin(), asteroids.end());
    int i = 0;
    for (i = 0; i < asteroids.size(); i++)
    {
      if (num >= asteroids[i])
        num += asteroids[i];
      else
        break;
    }
    return i == asteroids.size();
  }
};
int main()
{
  Solution s;

  return 0;
}
